import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

export const login = { 
  path: '/login',
  component: () => import('@/views/login/login.vue'),
  meta: { pagetitle: 'LOGIN' }
}

export const outerPage = {
  path: '/',
  redirect: '/home',
  component: () => import('@/views/pageBox.vue'),
  children: [
      // 主页 
      { path: '/home', component: () => import('@/views/home/home.vue'), meta: { pagetitle: 'Home' } },

      { path: '/menu/robe', component: () => import('@/views/design/kbigrobe/kbigrobe.vue') },
      { path: '/menu/kaften', component: () => import('@/views/design/kkaften/kkaften.vue') },
      { path: '/menu/style', component: () => import('@/views/design/stylePro/stylePro.vue'), meta: { pagetitle: 'Style' } },
      { path: '/menu/item/scene', component: () => import('@/views/design/scene/scene.vue'), meta: { pagetitle: 'Scene' } },

      { path: '/menu/production', component: () => import('@/views/commodity/finishedPro/finishedPro.vue'), meta: { pagetitle: 'Commodity' } },
      { path: '/menu/mdl', component: () => import('@/views/commodity/modulePro/modulePro.vue'), meta: { pagetitle: 'Module' } },

      { path: '/menu/activity/list', component: () => import('@/views/activity/festival/festival.vue'), meta: { pagetitle: 'FESTIVAL' } },

      // { path: '/menu/content', component: () => import('@/views/community/content/content.vue'), meta: { pagetitle: 'Content' } },

      { path: '/menu/order/production', component: () => import('@/views/orderRun/order/order.vue'), meta: { pagetitle: 'Order' } },
      { path: '/menu/order/mdl', component: () => import('@/views/orderRun/mdorder/mdorder.vue'), meta: { pagetitle: 'Modular order' } },
      { path: '/menu/order/after', component: () => import('@/views/orderRun/afterOrder/afterOrder.vue'), meta: { pagetitle: 'After order' } },
      // 二级页面
      { path: '/menu/sec/mdorderdet', component: () => import('@/views/mdorderPain/mdorderDet.vue'), meta: { pagetitle: 'Modular order details' } },

      { path: '/menu/mat/encode', component: () => import('@/views/material/codeRuleList/codeRuleList.vue'), meta: { pagetitle: 'Code rule list' } },
      { path: '/menu/mat/matDetail', component: () => import('@/views/material/matDetail/matDetail.vue'), meta: { pagetitle: 'Material detail' } },
      { path: '/menu/mat/bom', component: () => import('@/views/material/bom/bom.vue'), meta: { pagetitle: 'Bom' } },
      // 二级
      { path: '/menu/sec/bom', component: () => import('@/views/material/secBomMsg/secBomMsg.vue'), meta: { pagetitle: 'Bom detail' } },

      { path: '/menu/produce/production', component: () => import('@/views/outProess/finPro/finPro.vue'), meta: { pagetitle: 'Finished production' } },
      { path: '/menu/produce/mdl', component: () => import('@/views/outProess/mdl/mdl.vue'), meta: { pagetitle: 'Modular production plan' } },
      { path: '/menu/produce/purchase', component: () => import('@/views/outProess/purchase/purchase.vue'), meta: { pagetitle: 'Material purchasing' } },
      { path: '/menu/produce/suppliers', component: () => import('@/views/outProess/suppliers/suppliers.vue'), meta: { pagetitle: 'Supplier profile' } },

      { path: '/menu/user', component: () => import('@/views/userRun/user/user.vue'), meta: { pagetitle: 'User' } },

      { path: '/menu/feedback', component: () => import('@/views/service/feedback/feedback.vue'), meta: { pagetitle: 'Feedback' } },

      { path: '/menu/ele/robe', component: () => import('@/views/part/robes/robes.vue'), meta: { pagetitle: 'Robes' } },
      { path: '/menu/ele/kaften', component: () => import('@/views/part/kaften/kaften.vue'), meta: { pagetitle: 'Kaften' } },
      { path: '/menu/ele/pants', component: () => import('@/views/part/pants/pants.vue'), meta: { pagetitle: 'Pants' } },
      { path: '/menu/ele/fab', component: () => import('@/views/part/fabriclib/fabriclib.vue'), meta: { pagetitle: 'Fabric library' } },
      { path: '/menu/ele/emb', component: () => import('@/views/part/embroiderlib/embroiderlib.vue'), meta: { pagetitle: 'Embroider library' } },
      { path: '/menu/ele/fabgroup', component: () => import('@/views/part/fabgroup/fabgroup.vue'), meta: { pagetitle: 'Fabric group' } },


      { path: '/menu/stk/production', component: () => import('@/views/inventory/finished/finished.vue'), meta: { pagetitle: 'Finished' } },
      { path: '/menu/stk/mdl', component: () => import('@/views/inventory/fabric/fabric.vue'), meta: { pagetitle: 'Fabric' } },
      { path: '/menu/stk/mat', component: () => import('@/views/inventory/sufMat/sufMat.vue'), meta: { pagetitle: 'Surface material' } },
      { path: '/menu/stockMsg', component: () => import('@/views/inventory/warelocation/warelocation.vue'), meta: { pagetitle: 'Warehouse location' } },

      { path: '/menu/user/user', component: () => import('@/views/system/sysuser/sysuser.vue'), meta: { pagetitle: 'System user' } },
      { path: '/menu/user/role', component: () => import('@/views/system/role/role.vue'), meta: { pagetitle: 'Role' } },
      { path: '/menu/user/menu', component: () => import('@/views/system/menu/menu.vue'), meta: { pagetitle: 'Menu' } },

      { path: '/menu/picture/new', component: () => import('@/views/picture/new/newPic.vue'), meta: { pagetitle: 'New product' } },
      { path: '/menu/picture/hot', component: () => import('@/views/picture/hot/hotPic.vue'), meta: { pagetitle: 'Hot product' } },

      { path: '/404', component: () => import('@/views/error/404/404.vue'), meta: { pagetitle: 'error-404' } }
  ]
}

export const addRouter = []

const routes = [
  login,
  outerPage
]

const router = new VueRouter({
  routes,
  mode: 'history',
  base: '/astreweb'
})

export default router
